from django.db import models


# @Author henry14
class Member(models.Model):
    GENDER = (
        (u'male', u'MALE'),
        (u'female', u'FEMALE')
    )

    first_name = models.CharField('First Name', max_length=20, null=False)
    last_name = models.CharField('Last Name', max_length=20, null=False)
    others = models.CharField('Other Names', max_length=30, null=True, blank=True)
    cell_phone = models.CharField('Phone Number', max_length=20, null=False)
    email = models.CharField('Email Address', max_length=50, null=False)
    profession = models.CharField('Profession', max_length=50, null=False)
    gender = models.CharField('Gender', max_length=10, choices=GENDER)
    education_level = models.CharField('Education Level', max_length=20, null=False)
    date_joined = models.DateField('Joined on', auto_now_add= True)
    next_of_kin = models.CharField('Next of Kin', max_length=50, null=False)
    kin_relationship = models.CharField('Kin Relationship', max_length=10, null=False)
   # kin_phone = models.CharField('Phone N_O_K', max_length=20,null=False)

    class Meta:
        db_table = 'members'
        ordering = ['date_joined']

    def __unicode__(self):
        return u'%s %s %s' %(self.first_name, self.last_name, self.cell_phone)
